home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
007a
/
899track.zip
/
899MAIN.PRO
< prev
next >
Wrap
Text File
|
1990-03-06
|
4KB
|
104 lines
project "899"
include "899glob.pro"
% 899MAIN.PRO -- Main Program front end interface (GOAL is here)
PREDICATES
initialize % Initialization code
shutdown % Shutdown code
mainmenu % The main menu section
process(INTEGER) % Main router
GOAL
initialize,
mainmenu,
shutdown.
CLAUSES
initialize :-
EditAttr = bright_white + b_blue,
EditFrameAttr = EditAttr,
makewindow(100,EditAttr,EditFrameAttr,edit_title,10,0,14,79,clear_window,
center_title,double_line_frame),
makewindow(1,7,0,"Dos Coverup Window",0,0,24,79),
write("Reading Label Data file...please wait"),
openbase,
clearwindow.
shutdown :-
retract(datamodified), % Try to remove -- may fail
write("Saving Changed Data\n"),
clbase,
fail.
shutdown :-
removewindow, removewindow.
mainmenu :-
Attr = b_black + yellow,
FrameAttr = Attr,
Row = 2,
Column = 3,
Height = 20,
Width = 76,
makewindow(2,Attr,FrameAttr," WTHS Music Director's Rasta List ",
Row, Column, Height, Width, clear_window,
center_title, double_line_frame),
repeat,
clearwindow,
write("\n\n",
"\t1) Add Data to Label File.\n\n",
"\t2) Kill Useless data in Label File.\n\n",
"\t3) Modify Some particular item in Label File.\n\n",
"\t4) Print Mailing Labels (As addresses in label form).\n\n",
"\t5) Print Simple List of Data In Label File.\n\n",
"\t6) EXIT PROGRAM.\n\n\n\t\t"),
getIntOpt(1,6,Choice),
process(Choice),
Choice = 6, !,
removewindow.
process(1) :- !, % Add Data to label file
modspecs(label([],"",[],"","","","",[]),Q),
Q = label(Cats,Lab,Addr,City,State,Zip,Phone,Comments),
assertz(label(Cats,Lab,Addr,City,State,Zip,Phone,Comments)),
modifdat. % Toggle
process(2) :- !, % Kill Useless data
clearwindow,
cursor(0,0),
write("Building Choice menu...please wait\n"),
getLabelNames(CvtList),
show_get(CvtList,ChoiceToDelete,""), !, /* Get the choice FAILS on ESC */
label(Cats,ChoiceToDelete,AddressInfo,City,State,ZIP,Phone,Comments), !,
clearwindow,
write("RECORD LABEL : '",ChoiceToDelete,"'\n"),
write("CATEGORIES : ",Cats,'\n'),
write("ADDRESS INFO : ",AddressInfo,'\n'),
write("CITY, STATE ZIP : ",City,", ",State," ",ZIP,'\n'),
write("PHONE : ",Phone,'\n'),
write("COMMENTS --\n",Comments,'\n'),
write("\nDELETE This Record Label... are you SURE (Y/N)? "),
askyn, !,
retract(label(Cats,ChoiceToDelete,AddressInfo,City,State,ZIP,Phone,Comments)), !,
modifdat,
bep,
write("\n'",ChoiceToDelete,"' has been deleted from label list.\n"),
wait.
process(3) :- !, % Modify Some item
clearwindow,
cursor(0,0),
write("Building choice menu of selections for modification...."),
getLabelNames(CvtList),
show_get(CvtList,ChoiceToMod,""), !,
label(Cats,ChoiceToMod,Addr,City,State,Zip,Phone,Comments), !,
modspecs(label(Cats,ChoiceToMod,Addr,City,State,Zip,Phone,Comments),R),
retract(label(Cats,ChoiceToMod,Addr,City,State,Zip,Phone,Comments)), !,
R = label(Ncats,Nlab,Naddr,Ncity,Nstate,Nzip,Nphone,Ncomments),
assertz(label(Ncats,Nlab,Naddr,Ncity,Nstate,Nzip,Nphone,Ncomments)),
modifdat, !.
process(4) :- !, % Print Mailing Labels
label_print.
process(5) :- !, % Print Simple data list
sheet_print.
process(_). % That is all!!